<?php


namespace modules\web\controller;


use application\core\RedisUtil;
use application\core\SnowFlake;
use application\core\VerificationCode;

class TestController
{
    public function test(){
        //雪花id测试（redis情况下，和非redis情况下）
        $snowFlake = SnowFlake::instance();
        //array_unique
        $arr = [];
        for ($i=0;$i<=1000;$i++){
           $arr[] = $snowFlake->nextId();
        }
        echo count($arr);
        echo "<br>";
        echo count(array_unique($arr));
        echo $arr[count($arr)-1];
    }
}